﻿<!DOCTYPE html>
<html lang="en">
    <title>合同详情</title>
</head>
<link rel="stylesheet" href="/static/layui/css/layui.css" />
<body>
<form class="layui-form"  action="" lay-filter="edit">
<!--    <input type="hidden" name="id">-->
    <div class="layui-inline">
        <label class="layui-form-label">标题：</label>
        <div class="layui-input-inline">
            <input type="text" name="title" id="title" lay-verify="required" placeholder="请输入id" autocomplete="off" class="layui-input">
        </div>
    </div>

    <div class="layui-inline">
        <label class="layui-form-label">内容：</label>
        <div class="layui-input-inline">
            <input type="text" name="contents" id="contents" lay-verify="required" placeholder="请输入内容" autocomplete="off" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">创建时间：</label>
        <div class="layui-input-inline layui-col-md4">
            <input type="text" name="create_datetime" id="create_datetime"  required  lay-verify="required" placeholder="请输入公告创建的时间" autocomplete="off" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">状态：</label>
<!--        <div class="layui-input-inline layui-col-md4">-->
<!--            <input type="text" name="ann_status" id="ann_status"  required  lay-verify="required" placeholder="请输入状态" autocomplete="off" class="layui-input">-->
<!--        </div>-->
        <div class="layui-input-block">
            <input type="radio" name="ann_status" value="0" title="正常">
            <input type="radio" name="ann_status" value="1" title="丢弃" checked>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">修改时间：</label>
        <div class="layui-input-inline layui-col-md4">
            <input type="text" name="ann_date" id="ann_date"  required  lay-verify="required" placeholder="请输入公告修改的时间" autocomplete="off" class="layui-input">
        </div>
    </div>

</form>
</body>
<script src="/static/js/system.js"></script>
<script src="/js/jquery-3.4.1.min.js"></script>
<script src="/static/layui/layui.js"></script>
<script>
    $(function () {
        $("input").prop("disabled","disabled");
    })
    layui.use(['form','layer'], function(){
        var form = layui.form;
        $.ajax({
            url:'/announ/findId',
            type:"post",
            dataType:"json",
            data:{"id":getQueryString("id")},
            success:function (da) {
                console.log(da)
                if (da.code == 200) {
                    // form.val("edit", da.date);
                    form.val("edit", { //formTest 即 class="layui-form" 所在元素属性 lay-filter="" 对应的值
                        "title": da.date.title // "name": "value"
                        ,"contents": da.date.contents,
                        "create_datetime": layui.util.toDateString(da.create_datetime, 'yyyy-MM-dd')
                        ,"ann_status": da.date.ann_status
                        ,"ann_date": da.date.ann_date
                    });
                } else {
                    parent.layer.msg("详情查询失败！");
                }
            }
        });
    });

</script>
</html>